﻿using DevExpress.XtraGrid.Views.BandedGrid;
using DLL;
using NursingFormSystem.Model;
using ShiftProject.Transfusion;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NursingFormSystem.Transfusion
{
    public partial class RecordsSafeCareHistory : Form
    {
        #region 变量声明
        public NursingFormSystem.NurFormsService.NursingForm formService = new NursingFormSystem.NurFormsService.NursingForm();
        string[] user;
        string[] patientinfo;
        string FormName;
        string FormId;
        #endregion
        public RecordsSafeCareHistory(string[] UserParam, string[] patientInfo, string FormName, string FormID)
        {
            InitializeComponent();
            user = UserParam;
            this.patientinfo = patientInfo;
            this.FormName = FormName;
            this.FormId = FormID;
            LoadData("", "");
            SetBandGridView();
            dateStart.Properties.DisplayFormat.FormatString = "yyyy-MM-dd";
            dateStart.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
            dateStart.Text = DateTime.Now.ToString("yyyy-MM-01");
            dateEnd.Properties.DisplayFormat.FormatString = "yyyy-MM-dd";
            dateEnd.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
            dateEnd.Text = DateTime.Now.ToString("yyyy-MM-dd");
        }

        private void LoadData(string StatDate, string EndDate)
        {
            string patientid = this.patientinfo[0].ToString();//住院号
            int VisitId = Convert.ToInt32(patientinfo[1]);//住院次数
            int FormId = (int)FormType.Transfuse;//10001  //表单ID
            string select_sql = @"SELECT  * ,
                                    
''AS hzxx1,
''AS hzxx2,
''AS hzxx3,
''AS hzxx4,
''AS RH3,
''AS RH4,
''AS ShuXueRiQi1,
''AS ShuXueRiQi2,
''AS ShuXueRiQi3,
''AS brjbxx1,
''AS brjbxx2,
''AS xuexi1,
''AS xuexi2,
''AS xuexi3,
''AS xuexi4,
''AS RH1,
''AS RH2,
''AS xyzl_quanxue,
''AS xyzl_xfhxb,
''AS xyzl_xdhxb,
''AS xyzl_xxb,
''AS xyzl_xxbdxj,
''AS xyzl_qbdxj,
''AS xyzl_lcd,
''AS xyzl_qita,
''AS xyzl_qita2,
''AS xysl_u,
''AS xysl_ml,
''AS jiaocha1,
''AS jiaocha2,
''AS xdwg1,
''AS xdwg2,
''AS xdtxm1,
''AS xdtxm2,
''AS sxqqm_chz,
''AS sxqqm_fhz,
''AS cphdqm_chz,
''AS cphdqm_fhz,
''AS shijian1,
''AS shijian2,
''AS shijian3,
''AS shijian4,
''AS shijian5,
''AS shijian6,
''AS shenzhi1,
''AS shenzhi2,
''AS shenzhi3,
''AS shenzhi4,
''AS shenzhi5,
''AS shenzhi6,
''AS tiwen1,
''AS tiwen2,
''AS tiwen3,
''AS tiwen4,
''AS tiwen5,
''AS tiwen6,
''AS maibo1,
''AS maibo2,
''AS maibo3,
''AS maibo4,
''AS maibo5,
''AS maibo6,
''AS huxi1,
''AS huxi2,
''AS huxi3,
''AS huxi4,
''AS huxi5,
''AS huxi6,
''AS xueya1,
''AS xueya2,
''AS xueya3,
''AS xueya4,
''AS xueya5,
''AS xueya6,
''AS sudu1,
''AS sudu2,
''AS sudu3,
''AS sudu4,
''AS sudu5,
''AS sudu6,
''AS blfy1,
''AS blfy2,
''AS blfy3,
''AS blfy3_1,
''AS blfy4,
''AS blfy4_1,
''AS blfy5,
''AS blfy5_1,
''AS blfy6,
''AS blfy6_1,
''AS hsqm1,
''AS hsqm2,
''AS hsqm3,
''AS hsqm4,
''AS hsqm5,
''AS hsqm6,
''AS memoEditbuliangfanyin,
''AS xdbu1,
''AS xdbu2,

                                    SUBSTRING(' ', 1, 10) AS RiQi 
                            FROM    dbo.NursingFormRecord 
                            WHERE   FormId = {0} 
                                    AND patientid = '{1}' 
                                    AND VisitId = {2} {3} 
                            ORDER BY [AssessmentDate] DESC";

            string whereList = string.Empty;
            if (StatDate != "" && EndDate != "")
            {
                StatDate += " 00:00:00";
                EndDate += " 00:00:00";
                whereList = string.Format(" AND [AssessmentDate]>=CONVERT(DATETIME,'{0}') AND  [AssessmentDate]<CONVERT(DATETIME,'{1}')", StatDate, Convert.ToDateTime(EndDate).AddDays(1).ToString("yyyy-MM-dd HH:mm:ss"));
            }
            select_sql = string.Format(select_sql, FormId, patientid, VisitId, whereList);
            DataTable dt = (SqlHelper.ExecuteDataset(select_sql, CommandType.Text)).Tables[0];
            if (dt.Rows.Count <= 0) return;
            DataTable dtt = dt.Clone();
            string theTrue = "√";

            foreach (DataRow dr in dt.Rows)
            {
                var NursingFormData = Convert.ToString(dr["NursingFormData"]);
                Transfuse fd = new Transfuse();
                fd = XmlUtil.XMLToObject<Transfuse>(NursingFormData, Encoding.UTF8);
                DataRow newRow = dtt.NewRow();

                newRow["hzxx1"] = fd.XueXing.Equals("0") ? theTrue : string.Empty;
                newRow["hzxx2"] = fd.XueXing.Equals("1") ? theTrue : string.Empty;
                newRow["hzxx3"] = fd.XueXing.Equals("2") ? theTrue : string.Empty;
                newRow["hzxx4"] = fd.XueXing.Equals("3") ? theTrue : string.Empty;
                newRow["RH3"] = fd.RH.Equals("0") ? theTrue : string.Empty;
                newRow["RH4"] = fd.RH.Equals("1") ? theTrue : string.Empty;
                if (!string.IsNullOrEmpty( fd.ShuXueRiQi))
                {
                    newRow["ShuXueRiQi1"] = fd.ShuXueRiQi.Split('-')[0];
                    newRow["ShuXueRiQi2"] = fd.ShuXueRiQi.Split('-')[1];
                    newRow["ShuXueRiQi3"] = fd.ShuXueRiQi.Split('-')[2];
                }
                newRow["brjbxx1"] = fd.HeDuiNeiRong.BingRenJiBenXinXi.Equals("0") ? theTrue : string.Empty;
                newRow["brjbxx2"] = fd.HeDuiNeiRong.BingRenJiBenXinXi.Equals("1") ? theTrue : string.Empty;
                newRow["xuexi1"] = fd.HeDuiNeiRong.XueXing.Equals("0") ? theTrue : string.Empty;
                newRow["xuexi2"] = fd.HeDuiNeiRong.XueXing.Equals("1") ? theTrue : string.Empty;
                newRow["xuexi3"] = fd.HeDuiNeiRong.XueXing.Equals("2") ? theTrue : string.Empty;
                newRow["xuexi4"] = fd.HeDuiNeiRong.XueXing.Equals("3") ? theTrue : string.Empty;
                newRow["RH1"] = fd.HeDuiNeiRong.RH.Equals("0") ? theTrue : string.Empty;
                newRow["RH2"] = fd.HeDuiNeiRong.RH.Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_quanxue"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[0].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_xfhxb"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[1].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_xdhxb"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[2].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_xxb"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[3].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_xxbdxj"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[4].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_qbdxj"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[5].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_lcd"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[6].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_qita"] = fd.HeDuiNeiRong.XueYeZhongLei.Split('#')[7].Equals("1") ? theTrue : string.Empty;
                newRow["xyzl_qita2"] = fd.HeDuiNeiRong.XYZL_QiTa;
                newRow["xysl_u"] = fd.HeDuiNeiRong.XueYeShuLiang;
                newRow["xysl_ml"] = fd.HeDuiNeiRong.XueYeShuLiangml;
                newRow["jiaocha1"] = fd.HeDuiNeiRong.NingJiFanYing.Equals("0") ? theTrue : string.Empty;
                newRow["jiaocha2"] = fd.HeDuiNeiRong.NingJiFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["xdwg1"] = fd.HeDuiNeiRong.XueDaiWaiGuan.Equals("0") ? theTrue : string.Empty;
                newRow["xdwg2"] = fd.HeDuiNeiRong.XueDaiWaiGuan.Equals("1") ? theTrue : string.Empty;
                newRow["xdtxm1"] = fd.HeDuiNeiRong.XueDaiTiaoXingMa.Equals("0") ? theTrue : string.Empty;
                newRow["xdtxm2"] = fd.HeDuiNeiRong.XueDaiTiaoXingMa.Equals("1") ? theTrue : string.Empty;
                newRow["sxqqm_chz"] = fd.HeDuiNeiRong.SXQHDQM_ChuHeZhe.Equals("1") ? theTrue : string.Empty;
                newRow["sxqqm_fhz"] = fd.HeDuiNeiRong.SXQHDQM_FuHeZhe.Equals("1") ? theTrue : string.Empty;
                newRow["cphdqm_chz"] = fd.HeDuiNeiRong.CPHDQM_ChuHeZhe.Equals("1") ? theTrue : string.Empty;
                newRow["cphdqm_fhz"] = fd.HeDuiNeiRong.CPHDQM_FuHeZhe.Equals("1") ? theTrue : string.Empty;
                newRow["shijian1"] = fd.JianCeNeiRongList[0].ShiJian;
                newRow["shijian2"] = fd.JianCeNeiRongList[1].ShiJian;
                newRow["shijian3"] = fd.JianCeNeiRongList[2].ShiJian;
                newRow["shijian4"] = fd.JianCeNeiRongList[3].ShiJian;
                newRow["shijian5"] = fd.JianCeNeiRongList[4].ShiJian;
                newRow["shijian6"] = fd.JianCeNeiRongList[5].ShiJian;
                newRow["shenzhi1"] = fd.JianCeNeiRongList[0].ShenZhi;
                newRow["shenzhi2"] = fd.JianCeNeiRongList[1].ShenZhi;
                newRow["shenzhi3"] = fd.JianCeNeiRongList[2].ShenZhi;
                newRow["shenzhi4"] = fd.JianCeNeiRongList[3].ShenZhi;
                newRow["shenzhi5"] = fd.JianCeNeiRongList[4].ShenZhi;
                newRow["shenzhi6"] = fd.JianCeNeiRongList[5].ShenZhi;
                newRow["tiwen1"] = fd.JianCeNeiRongList[0].TiWen.Equals("1") ? theTrue : string.Empty;
                newRow["tiwen2"] = fd.JianCeNeiRongList[1].TiWen.Equals("1") ? theTrue : string.Empty;
                newRow["tiwen3"] = fd.JianCeNeiRongList[2].TiWen.Equals("1") ? theTrue : string.Empty;
                newRow["tiwen4"] = fd.JianCeNeiRongList[3].TiWen.Equals("1") ? theTrue : string.Empty;
                newRow["tiwen5"] = fd.JianCeNeiRongList[4].TiWen.Equals("1") ? theTrue : string.Empty;
                newRow["tiwen6"] = fd.JianCeNeiRongList[5].TiWen.Equals("1") ? theTrue : string.Empty;
                newRow["maibo1"] = fd.JianCeNeiRongList[0].MaiBo.Equals("1") ? theTrue : string.Empty;
                newRow["maibo2"] = fd.JianCeNeiRongList[1].MaiBo.Equals("1") ? theTrue : string.Empty;
                newRow["maibo3"] = fd.JianCeNeiRongList[2].MaiBo.Equals("1") ? theTrue : string.Empty;
                newRow["maibo4"] = fd.JianCeNeiRongList[3].MaiBo.Equals("1") ? theTrue : string.Empty;
                newRow["maibo5"] = fd.JianCeNeiRongList[4].MaiBo.Equals("1") ? theTrue : string.Empty;
                newRow["maibo6"] = fd.JianCeNeiRongList[5].MaiBo.Equals("1") ? theTrue : string.Empty;
                newRow["huxi1"] = fd.JianCeNeiRongList[0].HuXi.Equals("1") ? theTrue : string.Empty;
                newRow["huxi2"] = fd.JianCeNeiRongList[1].HuXi.Equals("1") ? theTrue : string.Empty;
                newRow["huxi3"] = fd.JianCeNeiRongList[2].HuXi.Equals("1") ? theTrue : string.Empty;
                newRow["huxi4"] = fd.JianCeNeiRongList[3].HuXi.Equals("1") ? theTrue : string.Empty;
                newRow["huxi5"] = fd.JianCeNeiRongList[4].HuXi.Equals("1") ? theTrue : string.Empty;
                newRow["huxi6"] = fd.JianCeNeiRongList[5].HuXi.Equals("1") ? theTrue : string.Empty;
                newRow["xueya1"] = fd.JianCeNeiRongList[0].XueYa.Equals("1") ? theTrue : string.Empty;
                newRow["xueya2"] = fd.JianCeNeiRongList[1].XueYa.Equals("1") ? theTrue : string.Empty;
                newRow["xueya3"] = fd.JianCeNeiRongList[2].XueYa.Equals("1") ? theTrue : string.Empty;
                newRow["xueya4"] = fd.JianCeNeiRongList[3].XueYa.Equals("1") ? theTrue : string.Empty;
                newRow["xueya5"] = fd.JianCeNeiRongList[4].XueYa.Equals("1") ? theTrue : string.Empty;
                newRow["xueya6"] = fd.JianCeNeiRongList[5].XueYa.Equals("1") ? theTrue : string.Empty;
                newRow["sudu1"] = fd.JianCeNeiRongList[0].SuDu != null && fd.JianCeNeiRongList[0].SuDu.Equals("1") ? theTrue : string.Empty;
                newRow["sudu2"] = fd.JianCeNeiRongList[0].SuDu != null && fd.JianCeNeiRongList[1].SuDu.Equals("1") ? theTrue : string.Empty;
                newRow["sudu3"] = fd.JianCeNeiRongList[0].SuDu != null && fd.JianCeNeiRongList[2].SuDu.Equals("1") ? theTrue : string.Empty;
                newRow["sudu4"] = fd.JianCeNeiRongList[0].SuDu != null && fd.JianCeNeiRongList[3].SuDu.Equals("1") ? theTrue : string.Empty;
                newRow["sudu5"] = fd.JianCeNeiRongList[0].SuDu != null && fd.JianCeNeiRongList[4].SuDu.Equals("1") ? theTrue : string.Empty;
                newRow["sudu6"] = fd.JianCeNeiRongList[0].SuDu != null && fd.JianCeNeiRongList[5].SuDu.Equals("1") ? theTrue : string.Empty;
                newRow["blfy1"] = fd.JianCeNeiRongList[0].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[0].BuLiangFanYing) && fd.JianCeNeiRongList[0].BuLiangFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["blfy2"] = fd.JianCeNeiRongList[1].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[1].BuLiangFanYing) && fd.JianCeNeiRongList[1].BuLiangFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["blfy3"] = fd.JianCeNeiRongList[2].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[2].BuLiangFanYing) && fd.JianCeNeiRongList[2].BuLiangFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["blfy3_1"] = fd.JianCeNeiRongList[2].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[2].BuLiangFanYing) && fd.JianCeNeiRongList[2].BuLiangFanYing.Equals("1") ? string.Empty : theTrue;
                newRow["blfy4"] = fd.JianCeNeiRongList[3].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[3].BuLiangFanYing) && fd.JianCeNeiRongList[3].BuLiangFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["blfy4_1"] = fd.JianCeNeiRongList[3].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[3].BuLiangFanYing) && fd.JianCeNeiRongList[3].BuLiangFanYing.Equals("1") ?  string.Empty: theTrue;
                newRow["blfy5"] = fd.JianCeNeiRongList[4].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[4].BuLiangFanYing) && fd.JianCeNeiRongList[4].BuLiangFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["blfy5_1"] = fd.JianCeNeiRongList[4].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[4].BuLiangFanYing) && fd.JianCeNeiRongList[4].BuLiangFanYing.Equals("1") ?  string.Empty: theTrue;
                newRow["blfy6"] = fd.JianCeNeiRongList[5].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[5].BuLiangFanYing) && fd.JianCeNeiRongList[5].BuLiangFanYing.Equals("1") ? theTrue : string.Empty;
                newRow["blfy6_1"] = fd.JianCeNeiRongList[5].BuLiangFanYing != null && !string.IsNullOrEmpty(fd.JianCeNeiRongList[5].BuLiangFanYing) && fd.JianCeNeiRongList[5].BuLiangFanYing.Equals("1") ?  string.Empty: theTrue;

                newRow["hsqm1"] = fd.JianCeNeiRongList[0].HuShiQianMing.Equals("1") ? theTrue : string.Empty;
                newRow["hsqm2"] = fd.JianCeNeiRongList[1].HuShiQianMing.Equals("1") ? theTrue : string.Empty;
                newRow["hsqm3"] = fd.JianCeNeiRongList[2].HuShiQianMing.Equals("1") ? theTrue : string.Empty;
                newRow["hsqm4"] = fd.JianCeNeiRongList[3].HuShiQianMing.Equals("1") ? theTrue : string.Empty;
                newRow["hsqm5"] = fd.JianCeNeiRongList[4].HuShiQianMing.Equals("1") ? theTrue : string.Empty;
                newRow["hsqm6"] = fd.JianCeNeiRongList[5].HuShiQianMing.Equals("1") ? theTrue : string.Empty;

                newRow["memoEditbuliangfanyin"] = fd.BuLiangFanYingQingKuang.BLFYQK_NeiRong;
                newRow["xdbu1"] = fd.BuLiangFanYingQingKuang.XueDaiBaoCun.Equals("0") ? theTrue : string.Empty;
                newRow["xdbu2"] = fd.BuLiangFanYingQingKuang.XueDaiBaoCun.Equals("1") ? theTrue : string.Empty;

                newRow["RiQi"] = string.IsNullOrEmpty(fd.ShuXueRiQi) ? string.Empty : Convert.ToDateTime(fd.ShuXueRiQi).ToString("yyyy-MM-dd");
                //ID隐藏，双击触发事件
                newRow["Id"] = dr["ID"];
                dtt.Rows.Add(newRow);
            }

            gridControl1.DataSource = dtt;
        }

        private void SetBandGridView()
        {
            foreach (GridBand gridBand in this.bandedGridView1.Bands)//设置居中
            {
                foreach (GridBand gridBandSecond in gridBand.Children)
                {
                    gridBandSecond.OptionsBand.FixedWidth = true;
                    gridBandSecond.AppearanceHeader.Options.UseTextOptions = true;
                    gridBandSecond.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                    gridBandSecond.AppearanceHeader.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
                }
                gridBand.OptionsBand.FixedWidth = true;
                gridBand.AppearanceHeader.Options.UseTextOptions = true;
                gridBand.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                gridBand.AppearanceHeader.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center;
            }
        }

        #region 查询
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string StatDate = this.dateStart.Text;
            string EndDate = this.dateEnd.Text;

            if (string.IsNullOrEmpty(StatDate) || string.IsNullOrEmpty(EndDate))
            {
                MessageBox.Show("查询日期不能为空！");
            }
            LoadData(StatDate, EndDate);
        }
        #endregion

        #region  新增
        private void btnAdd_Click(object sender, EventArgs e)
        {
            RecordsSafeCare addForm = new RecordsSafeCare(user, patientinfo, string.Empty);
            addForm.ShowDialog();
            if (addForm.DialogResult == DialogResult.OK)
            {
                LoadData("", "");
            }
        }
        #endregion

        #region  修改
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (bandedGridView1.RowCount > 0)
            {
                string Id = bandedGridView1.GetRowCellValue(bandedGridView1.FocusedRowHandle, "Id").ToString();
                RecordsSafeCare addForm = new RecordsSafeCare(user, patientinfo, Id);
                addForm.ShowDialog();
                if (addForm.DialogResult == DialogResult.OK)
                {
                    LoadData("", "");
                }
            }
        }
        private void bandedGridView1_DoubleClick(object sender, EventArgs e)
        {
            if (bandedGridView1.RowCount > 0)
            {
                string Id = bandedGridView1.GetRowCellValue(bandedGridView1.FocusedRowHandle, "Id").ToString();
                RecordsSafeCare addForm = new RecordsSafeCare(user, patientinfo, Id);
                addForm.ShowDialog();
                if (addForm.DialogResult == DialogResult.OK)
                {
                    LoadData("", "");
                }
            }
        }
        #endregion

        #region  打印
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string patientId = patientinfo[0];
            string visit = patientinfo[1];
            //单张打印
            //RecordsSafePrint f = new RecordsSafePrint(patientId, Convert.ToInt32(visit), (int)FormType.Transfuse);
            //多张打印
            RecordsSafePrints f = new RecordsSafePrints(patientinfo, (int)FormType.Transfuse, dateStart.DateTime, dateEnd.DateTime, string.Empty);
            f.Show();
        }
        #endregion

        #region  删除
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定要删除数据吗？", "删除前确认", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                string id = bandedGridView1.GetRowCellValue(bandedGridView1.FocusedRowHandle, "Id").ToString();
                var ret2 = formService.DeleteNursingFormRecord(id);
                MessageBox.Show(ret2.M);
                if (ret2.Code == 1)
                {
                    string dateStart = this.dateStart.Text;
                    string dateEnd = this.dateEnd.Text;
                    LoadData(dateStart, dateEnd);
                }
            }
        }
        #endregion

        #region 开始时间
        private void dateStart_EditValueChanged(object sender, EventArgs e)
        {
            btnSearch_Click(null, null);
        }
        #endregion

        #region 结束时间
        private void dateEnd_EditValueChanged(object sender, EventArgs e)
        {
            btnSearch_Click(null, null);
        }
        #endregion



    }
}
